using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class therapy_planMap : EntityTypeConfiguration<therapy_plan>
    {
        public therapy_planMap()
        {
            // Primary Key
            this.HasKey(t => t.therapy_plan_id);

            // Properties
            this.Property(t => t.therapy_plan_id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.therapy_plan_name)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.therapy_plan_desc)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("therapy_plan");
            this.Property(t => t.therapy_plan_id).HasColumnName("therapy_plan_id");
            this.Property(t => t.therapy_plan_name).HasColumnName("therapy_plan_name");
            this.Property(t => t.disable_flag).HasColumnName("disable_flag");
            this.Property(t => t.therapy_plan_desc).HasColumnName("therapy_plan_desc");
            this.Property(t => t.therapy_plan_sbp_goal).HasColumnName("therapy_plan_sbp_goal");
            this.Property(t => t.bp_level_id).HasColumnName("bp_level_id");
            this.Property(t => t.therapy_plan_dbp_goal).HasColumnName("therapy_plan_dbp_goal");
        }
    }
}
